package com.hjm.project.ActTerminalModel.ActTerminalModel.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;
import com.hjm.project.ActTerminalModel.ActTerminalModel.mapper.ActTerminalModelMapper;
import com.hjm.project.ActTerminalModel.ActTerminalModel.domain.ActTerminalModel;
import com.hjm.project.ActTerminalModel.ActTerminalModel.service.IActTerminalModelService;
import com.hjm.common.utils.text.Convert;

import javax.annotation.Resource;

/**
 * 活动匹配终端Service业务层处理
 * 
 * @author ActTerminalModel
 * @date 2020-11-28
 */
@Service
public class ActTerminalModelServiceImpl implements IActTerminalModelService 
{
    @Resource
    private ActTerminalModelMapper actTerminalModelMapper;


    @Override
    public List<Map<String, Object>> getActTerminalModel(Map<String, Object> map) throws Exception {
        return actTerminalModelMapper.getActTerminalModel(map);
    }

    /**
     * 查询活动匹配终端
     * 
     * @param id 活动匹配终端ID
     * @return 活动匹配终端
     */
    @Override
    public ActTerminalModel selectActTerminalModelById(Long id)
    {
        return actTerminalModelMapper.selectActTerminalModelById(id);
    }

    /**
     * 查询活动匹配终端列表
     * 
     * @param actTerminalModel 活动匹配终端
     * @return 活动匹配终端
     */
    @Override
    public List<ActTerminalModel> selectActTerminalModelList(ActTerminalModel actTerminalModel)
    {
        return actTerminalModelMapper.selectActTerminalModelList(actTerminalModel);
    }

    /**
     * 新增活动匹配终端
     * 
     * @param actTerminalModel 活动匹配终端
     * @return 结果
     */
    @Override
    public int insertActTerminalModel(ActTerminalModel actTerminalModel)
    {
        return actTerminalModelMapper.insertActTerminalModel(actTerminalModel);
    }

    /**
     * 修改活动匹配终端
     * 
     * @param actTerminalModel 活动匹配终端
     * @return 结果
     */
    @Override
    public int updateActTerminalModel(ActTerminalModel actTerminalModel)
    {
        return actTerminalModelMapper.updateActTerminalModel(actTerminalModel);
    }

    /**
     * 删除活动匹配终端对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteActTerminalModelByIds(String ids)
    {
        return actTerminalModelMapper.deleteActTerminalModelByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除活动匹配终端信息
     * 
     * @param id 活动匹配终端ID
     * @return 结果
     */
    @Override
    public int deleteActTerminalModelById(Long id)
    {
        return actTerminalModelMapper.deleteActTerminalModelById(id);
    }


    @Override
    public boolean batchInsertActTerminalModel(List<Map<String,Object>> list) throws Exception {
        return actTerminalModelMapper.batchInsertActTerminalModel(list)>0;
    }


    @Override
    public boolean updateActTerminalModels(Map<String, Object> map) throws Exception {
        return actTerminalModelMapper.updateActTerminalModels(map)>0;
    }
}
